<!DOCTYPE html>
<html>
  <body style="font: 75% Lucida Grande, Trebuchet MS">
    <div id="content"></div>
    <p id="log" style="color: gray"></p>
    <script type="text/javascript">
        localStorage.remove("counter");
      if (!localStorage.getItem('counter')) {    
          localStorage.setItem('counter', 0);
      } else {
          var c = localStorage.getItem('counter');
          c++;
          localStorage.setItem('counter', c);
      }
      
      alert(localStorage.getItem('counter'));
    </script>
  </body>
</html>​